# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=gthumb
pkgver=3.10.4
pkgrel=1
pkgdesc="Image browser and viewer for the GNOME Desktop"
url="https://wiki.gnome.org/Apps/gthumb"
arch=(x86_64)
license=(GPL)
depends=(dconf librsvg clutter-gtk gst-plugins-base-libs gsettings-desktop-schemas libwebp
         libsecret libsoup webkit2gtk json-glib gst-plugin-gtk)
makedepends=(libchamplain exiv2 brasero libraw liboauth docbook-xsl yelp-tools meson git)
optdepends=('libraw: read RAW files'
            'exiv2: metadata support'
            'libchamplain: map viewer'
            'brasero: burn discs'
            'liboauth: web albums')
_commit=0395f9e83d87e24f1c78fd89b12724fcbb4d069a  # tags/3.10.4^0
source=("git+https://gitlab.gnome.org/GNOME/gthumb.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D libchamplain=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
